/***************************************************************************
 *   Copyright (C) 2006 by Matej Svejda                                    *
 *   mata@aw-modell.at                                                     *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/

#include "accentselect.h"
#include "accentselect.moc"


AccentSelect::AccentSelect(int type, QWidget *parent, const char *name) :
	QWidget(parent, name)
{
	select = new KComboBox(false, this);

	select->insertItem(i18n("Normal"));
	select->insertItem(i18n("2/4"));
	select->insertItem(i18n("3/4"));
	select->insertItem(i18n("4/4"));
	
	if(type >= 0) {
		select->setCurrentItem(type);
	}
	
	connect(select, SIGNAL(activated(int)), this, SLOT(calculateAccentuated(int)));
	
	QHBoxLayout *layout = new QHBoxLayout(this);
	layout->addWidget(select);
}


AccentSelect::~AccentSelect()
{
}

void AccentSelect::calculateAccentuated(int type)
{
	int accentuated; // Which note is accentuated.
	switch(type) {
		case 0: {
			accentuated = -1;
			break;
		} case 1: {
			accentuated = 2;
			break;
		} case 2: {
			accentuated = 3;
			break;
		} case 3: {
			accentuated = 4;
			break;
		}
	}
	emit accentChanged(accentuated);
}

